﻿using xfsale.domain;

namespace xfsale.lib
{
    public class Global
    {
        private string _sysStatus;
        private string _sysWorkDay;
        private string _sysNextWorkDay;
        private string _sysVersion;
        private string _logLevel;
        private string _logTo;
        private string _logFile;
        private string _distributorCode;
        private string _regionCode;
        private string _branchCode;
        private string _netCode;
        private string _opCode;
        private string _opName;

        public string DistributorCode
        {
            get { return this._distributorCode; }
            set { this._distributorCode = value; }
        }

        public string RegionCode
        {
            get { return this._regionCode; }
            set { this._regionCode = value; }
        }

        public string BranchCode
        {
            get { return this._branchCode; }
            set { this._branchCode = value; }
        }

        public string NetCode
        {
            get { return this._netCode; }
            set { this._netCode = value; }
        }

        public string OpCode
        {
            get { return this._opCode; }
            set { this._opCode = value; }
        }

        public string OpName
        {
            get { return this._opName; }
            set { this._opName = value; }
        }

        public string SysStatus
        {
            get { return this._sysStatus; }
            set { this._sysStatus = value; }
        }

        public string SysStatusText
        {
            get
            {
                if (App.DictItems.ContainsKey("SYSSTATUS"))
                {
                    SysDictItem dictItem = App.DictItems["SYSSTATUS"] as SysDictItem;
                    SysDictValue dictValue = dictItem.valueItems[_sysStatus] as SysDictValue;
                    return dictValue.valueDesc;
                }

                return _sysStatus;
            }
        }

        public string SysWorkDay
        {
            get { return this._sysWorkDay; }
            set { this._sysWorkDay = value; }
        }

        public string SysNextWorkDay
        {
            get { return this._sysNextWorkDay; }
            set { this._sysNextWorkDay = value; }
        }

        public string SysVersion
        {
            get { return this._sysVersion; }
            set { this._sysVersion = value; }
        }

        public string LogLevel
        {
            get { return this._logLevel; }
            set { this._logLevel = value; }
        }

        public string LogTo
        {
            get { return this._logTo; }
            set { this._logTo = value; }
        }

        public string LogFile
        {
            get { return this._logFile; }
            set { this._logFile = value; }
        }
    }
}
